
#include <linux/module.h>
#include <linux/moduleparam.h>
 
#define MAJOR_NUM 123 
#define MINOR_NUM 0
 
MODULE_AUTHOR("mdy");
MODULE_DESCRIPTION("module param demo");
MODULE_LICENSE("GPL");
 

static int iParam = 0;
static char* strParam = NULL;
static char strParam2[128] = {0}; 

module_param(iParam, int, S_IRUGO | S_IWUSR);
module_param(strParam, charp, S_IRUGO | S_IWUSR);
module_param_string(para2, strParam2, 128, S_IRUGO | S_IWUSR);

static int __init param_demo_init(void)
{
    printk("iParam = %d, strParam = %s, strParam2 = %s\n", iParam, strParam, strParam2);
    return 0;
}

static void __exit param_demo_exit(void)
{
    return;
}
 
module_init(param_demo_init);
module_exit(param_demo_exit);

